<?php
class StatisticsController extends AppController {

	var $name = 'Statistics';
	var $helpers = array('Time');	
	var $uses = array('Article','News','Comment','User');

	function admin_index() {
		$itemsOnPage = Configure::read('Statistics.displayed.items');
		$articles = $this->Article->findAll(array('visible'=>1),array("id","seo_link","created","title"),array("created" => "desc"),$itemsOnPage);
		$comments = $this->Comment->findAll(null,array("Comment.id","Comment.title","Article.seo_link","Article.created"),array("Comment.created" => "desc"),$itemsOnPage);
		$news = $this->News->findAll(null,array("title","created","seo_link"),array("News.created"=>"desc"),$itemsOnPage);
		$users = $this->User->findAll(null,array("username","id"),array("User.created"=>"desc"),$itemsOnPage);
		
		$this->set(compact("articles","comments","news","users"));
	 }
}
?>